<template>
  <div>
    <el-dialog :close-on-click-modal="false" v-model="visible" :title="title">
      <add :setVisible="setVisible" v-if="userid===0" />
      <editt :setVisible="setVisible" :userid="userid" :aaa="aaa" v-else />
      <!-- <el-form label-width="90px"> -->
      <!-- <el-form-item label="红娘姓名" prop="realname">
        <el-input v-model="getrow.realname" /> 
      </el-form-item> -->
     <!-- </el-form>  -->
    </el-dialog>
  </div>
</template>

<script setup lang="ts">
import type { UserListType } from "@/typings/ladyType";
import add from "./add.vue";
import editt from './editt.vue'
import {reactive, computed ,ref} from "vue";
import type { Ref } from "vue";
import { avatarProps } from "element-plus";
interface IProps {
  dialogFormVisible: boolean;
  setVisible: (v: boolean) => void;
  userid: number;
  getrow:any
  
}
interface IEmits {
  (e: "setVisible", v: boolean): void;
  
}


// console.log(getrow.userid)
const props = defineProps<IProps>();
const aaa=props.getrow
const emit = defineEmits<IEmits>();

// 使用计算属性来动态设置对话框的标题
const title = computed(() => {
  return props.userid === 0 ? "添加" : "修改";
});
const visible = computed({
  get() {
    return props.dialogFormVisible;
    
  },
  set(v: boolean) {
    emit("setVisible", v);
    
  },
  
});

// console.log(props.getrow)
</script>

<style scoped lang="scss"></style>
